<?php defined('KX_ROOT') || exit('Permission denied');?><!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
	<title>用户中心 - <?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></title>
	<link rel="stylesheet" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/css/global.css"/>
	<link rel="stylesheet" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/css/style.css"/>
</head>
<body>

	<!-- 头部 -->
    <div class="pt-top-nav">
    <ul class="content">
        <li class="fl">
            欢迎访问<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?>小说网
        </li>
        <li class="fr m">
            <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/images/shortcut_icon.png" class="pt-shortcut-icon">
            <span class="cursor color4 lh100" onclick="toDesktop('<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "siteurl");?>','<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?>')">桌面快捷</span>
        </li>
        <li class="fr mr20">
            <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/images/star_icon.png" class="pt-index-icon">
            <span class="cursor color4 lh100" onclick="addFavorite(document.title,window.location);">加入收藏</span>
        </li>
        <li class="fr mr20">
            <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/images/index_icon.png" class="pt-index-icon">
            <span class="cursor color4 lh100" onclick="setHome(this);">设为首页</span>
        </li>
    </ul>
</div>
<div class="w100 pt-head-bg">
    <div class="pt-head">
        <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/static/image/logo.png" class="pt-logo" title="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?>">
        <div class="pt-search-box">
            <form action="<?php echo \Kuxin\Helper\Url::build("novel.search.result",[],"");?>">
                <div class="pt-serachbg">
                    <input type="text" name="searchkey" placeholder="请输入您要搜索的书名" class="pt-serarch-input" value="<?php echo $_GET['searchkey'];?>">
                </div>
                <button type="submit" class="pt-search-btn">
                    <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/images/search.png" class="pt-search-icon">
                </button>
            </form>
        </div>
        <ul class="inline-block size14 color4 fr pt-head-list">
            <li>
                <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/images/person_icon.png" class="pt-person-icon">
                <?php if(($islogin)):?>
                <span class="color2 lh100">
                    <a href="<?php echo \Kuxin\Helper\Url::build("user.index.index",[],"");?>" class="color2"><?php echo $userinfo['nickname']?:$userinfo['name'];?></a>
                    <span>|</span>
                    <a href="<?php echo \Kuxin\Helper\Url::build("user.pay.recharge",[],"");?>" class="color2">充值</a>
                </span>
                <?php else:?>
                <span class="color2 lh100"><a title="登录" href="<?php echo \Kuxin\Helper\Url::build("user.auth.login",[],"");?>" class="color2">登录</a> | <a title="注册" href="<?php echo \Kuxin\Helper\Url::build("user.auth.register",[],"");?>" class="color2">注册</a></span>
                <?php endif;?>
            </li>
            <li>
                <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/images/book_icon.png" class="pt-book-icon">
                <a rel="nofollow" href="<?php echo \Kuxin\Helper\Url::build("user.mark.index",[],"");?>" class="color4 lh100">我的书架</a>
            </li>
            <li class="inline-block">
                <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/images/history_icon.png" class="pt-history-icon">
                <a rel="nofollow" href="<?php echo \Kuxin\Helper\Url::build("user.history.index",[],"");?>" class="color4 lh100">阅读历史</a>
            </li>
        </ul>
    </div>
</div>

<!-- 导航栏 -->
<div class="pt-navbg">
    <div class="pt-nav">
        <a title="首页" href="<?php echo \Kuxin\Helper\Url::build("index.index",[],"");?>"<?php if($pagesign=='index'):?> class="pt-active"<?php endif;?>>首页</a>
        <a title="排行" href="<?php echo \Kuxin\Helper\Url::build("novel.rank.index",[],"");?>"<?php if($pagesign=='rank'):?> class="pt-active"<?php endif;?>>排行</a>
        <a title="分类" href="<?php echo \Kuxin\Helper\Url::build("novel.category.index",[],"");?>"<?php if($pagesign=='category'):?> class="pt-active"<?php endif;?>>分类</a>
        <a title="完本" href="<?php echo \Kuxin\Helper\Url::build("novel.over.index",[],"");?>"<?php if($pagesign=='over'):?> class="pt-active"<?php endif;?>>完本</a>
        <a title="书单" href="<?php echo \Kuxin\Helper\Url::build("booklist.booklist.index",[],"");?>"<?php if($pagesign=='booklist'):?> class="pt-active"<?php endif;?>>书单</a>
        <a title="专题" href="<?php echo \Kuxin\Helper\Url::build("special.index",[],"");?>"<?php if($pagesign=='special'):?> class="pt-active"<?php endif;?>>专题</a>
        <a title="用户中心" href="<?php echo \Kuxin\Helper\Url::build("user.index.index",[],"");?>" class="fr<?php if($pagesign=='user'):?>  pt-active<?php endif;?>">用户中心</a>
        <a title="原创专区" href="<?php echo \Kuxin\Helper\Url::build("author.author.index",[],"");?>" class="fr" target="_blank">原创专区</a>
    </div>
</div>
	<!-- 内容 -->
	<div class="pt-content">
		<!-- 面包屑 -->
		<div class="pt-crumb">
			<img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/images/crumb_icon.png" class="pt-crumb-icon">
			<span class="color5">
                <a href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "siteurl");?>"><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></a> > <a href="<?php echo \Kuxin\Helper\Url::build("user.index.index",[],"");?>" class="color5">用户中心</a>
            </span>
		</div>

		<!-- 一楼 -->
		<div class="pt-floor1">
            <div class="pt-list">
    <!-- 我的 -->
    <div class="fr pt-toplist">
        <div class="border-b size18 bold color8 pb10 pt-toplist-title">我的</div>
        <div class="pt-toplist-item">
            <a href="<?php echo \Kuxin\Helper\Url::build("user.index.index",[],"");?>"<?php if($userleftsign=='index'):?> class="color2"<?php endif;?>><span class="mr10">·</span>个人中心</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.vip.index",[],"");?>"<?php if($userleftsign=='vip'):?> class="color2"<?php endif;?>><span class="mr10">·</span>超级会员</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.assets.index",[],"");?>"<?php if(in_array($userleftsign,['assets','ticket'])):?> class="color2"<?php endif;?>><span class="mr10">·</span>我的资产</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.mark.index",[],"");?>"<?php if($userleftsign=='mark'):?> class="color2"<?php endif;?>><span class="mr10">·</span>我的书架</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.history.index",[],"");?>"<?php if($userleftsign=='history'):?> class="color2"<?php endif;?>><span class="mr10">·</span>阅读历史</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.booklist.index",[],"");?>"<?php if($userleftsign=='booklist'):?> class="color2"<?php endif;?>><span class="mr10">·</span>我的书单</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.vote.index",[],"");?>"<?php if($userleftsign=='vote'):?> class="color2"<?php endif;?>><span class="mr10">·</span>我的推荐</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.comment.publish",[],"");?>"<?php if($userleftsign=='comment'):?> class="color2"<?php endif;?>><span class="mr10">·</span>我的评论</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.sign.index",[],"");?>"<?php if($userleftsign=='sign'):?> class="color2"<?php endif;?>><span class="mr10">·</span>我的签到</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.star.index",[],"");?>"<?php if($userleftsign=='star'):?> class="color2"<?php endif;?>><span class="mr10">·</span>我的评分</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.invite.index",[],"");?>"<?php if($userleftsign=='invite'):?> class="color2"<?php endif;?>><span class="mr10">·</span>我的邀请</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("author.author.index",[],"");?>" target="_blank"><span class="mr10">·</span>原创专区</a>
        </div>
    </div>
    <!-- 设置 -->
    <div class="fr pt-toplist none">
        <div class="border-b bold size18 color8 pb10 pt-toplist-title">财务</div>
        <div class="pt-toplist-item">
            <a href="<?php echo \Kuxin\Helper\Url::build("user.charge.index",[],"");?>"<?php if($userleftsign=='charge'):?> class="color2"<?php endif;?>><span class="mr10">·</span>充值记录</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.consume.index",[],"");?>"<?php if($userleftsign=='consume'):?> class="color2"<?php endif;?>><span class="mr10">·</span>消费记录</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.reward.index",[],"");?>"<?php if($userleftsign=='reward'):?> class="color2"<?php endif;?>><span class="mr10">·</span>打赏记录</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.distribution.index",[],"");?>"<?php if($userleftsign=='distribution'):?> class="color2"<?php endif;?>><span class="mr10">·</span>分销记录</a>
        </div>
    </div>
    <div class="fr pt-toplist">
        <div class="border-b bold size18 color8 pb10 pt-toplist-title">设置</div>
        <div class="pt-toplist-item">
            <a href="<?php echo \Kuxin\Helper\Url::build("user.info.index",[],"");?>"<?php if($userleftsign=='info'):?> class="color2"<?php endif;?>><span class="mr10">·</span>基础资料</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.info.pwd",[],"");?>"<?php if($userleftsign=='pwd'):?> class="color2"<?php endif;?>><span class="mr10">·</span>修改密码</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.info.bind",[],"");?>"<?php if($userleftsign=='bind'):?> class="color2"<?php endif;?>><span class="mr10">·</span>账号绑定</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.auth.logout",[],"");?>"><span class="mr10">·</span>退出登录</a>
        </div>
    </div>
</div>
<style>
    .pt-rank:not(.pt-user){
        min-height: 630px;
    }
</style>
			<div class="relative pt-rank pt-user">
				<div class="pt-user-first">
                    <div class="inline-block fl mr20">
                        <img src="<?php echo $userinfo['avatar'];?>" alt="<?php echo $userinfo['name'];?>">
                    </div>
                    <div class="inline-block fl pt-user-info">
                        <div>
                            <?php $isvip=\Kuxin\Block::show('user.isvip', ['userid'=>$userinfo['id']]);?>
                            <a href="<?php echo \Kuxin\Helper\Url::build("user.vip.index",[],"");?>">
                                <img class="mr15" src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/images/vip<?php echo $isvip?'_active':'';?>.png" alt="超级会员" style="vertical-align: middle;margin-top: -5px;">
                            </a>
                            <span class="inline-block size18 bold color6 mr40 username"><?php echo $userinfo['nickname']?:$userinfo['name'];?></span>
                            <?php if(date('Ymd')>$userinfo['data']['sign_day']):?>
                            <button class="btn-sign">签到</button>
                            <?php else:?>
                            <button class="btn-sign btn-signed">已签到</button>
                            <?php endif;?>
                        </div>
                        <div class="color6 pt-user-data">
                            <div class="inline-block fl">
                                <ul>
                                    <li>我的等级：<span class="user-level-name"><?php echo $userinfo['group']['name'];?></span></li>
                                    <li>我的<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.exp_caption");?>：<span class="user-exp"><?php echo $userinfo['exp'];?></span></li>
                                    <li>我的<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.point_caption");?>：<span class="user-print"><?php echo $userinfo['point'];?></span></li>
                                    <li>登录次数：<?php echo $userinfo['data']['login_num'];?>次</li>
                                    <li><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.money_caption");?>余额：<span class="color2 user-money"><?php echo $userinfo['assets']['balance'];?></span></li>
                                    <li><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.ticket_caption");?>数量：<span class="color2 user-free-money"><?php echo $userinfo['assets']['surplus_ticket'];?></span></li>
                                </ul>
                            </div>
                            <div class="inline-block fl">
                                <div>
                                    我的登录进度：
                                    <div class="inline-block pt-user-level">
                                        <div class="inline-block user-level-name"><?php echo $userinfo['group']['name'];?></div>
                                        <div class="inline-block w120 progress">
                                            <?php if(empty($userinfo['group']['next'])):?>
                                            <div class="progress-bar" style="width: 100%;"></div>
                                            <?php else:?>
                                            <div class="progress-bar" style="width: <?php echo $userinfo['group']['next']['progress'];?>%;"></div>
                                            <?php endif;?>
                                        </div>
                                        <?php if(!empty($userinfo['group']['next'])):?>
                                        <div class="inline-block color2 user-next-level-name"><?php echo $userinfo['group']['next']['name'];?></div>
                                        <?php endif;?>
                                    </div>
                                </div>
                                <div>
                                    上次登录时间：<?php echo \Kuxin\View::date($userinfo['data']['login_time'],"Y-m-d H:i:s");?>
                                </div>
                                <div>
                                    上次登录地址：<?php echo $userinfo['data']['login_ip'];?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="pt-user-stat">
                    <ul class="text-center">
                        <?php $marknum=\Kuxin\Block::show('mark.num', ['userid'=>$userinfo['id']]);?>
                        <li class="inline-block mt30">
                            <div><span class="size24 color6"><?php echo $marknum;?></span> <span>本</span></div>
                            <div><span class="size16">我收藏的</span></div>
                        </li>
                        <li class="inline-block mt30">
                            <div><span class="size24 color6"><?php echo $userinfo['data']['vote_num']?:0;?></span> <span>本</span></div>
                            <div><span class="size16">我推荐过</span></div>
                        </li>
                        <li class="inline-block mt30">
                            <div><span class="size24 color6"><?php echo $userinfo['data']['star_num']?:0;?></span> <span>本</span></div>
                            <div><span class="size16">我打分过</span></div>
                        </li>
                        <li class="inline-block mt30">
                            <div><span class="size24 color6"><?php echo $userinfo['data']['comment_num']?:0;?></span> <span>本</span></div>
                            <div><span class="size16">我评论过</span></div>
                        </li>
                    </ul>
                </div>
			</div>
            <div class="relative pt-user-table mt10">
                <div style="line-height: 18px;margin-bottom:30px;">
                    <span class="size18 color2 mr10">签到记录</span>
                    <a class="fr" href="<?php echo \Kuxin\Helper\Url::build("user.sign.index",[],"");?>">查看全部+</a>
                </div>
                <div>
                    <table class="sign-records">
                        <thead>
                            <tr>
                                <th>签到时间</th>
                                <th>连签次数</th>
                                <th><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.exp_caption");?>奖励</th>
                                <th><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.point_caption");?>奖励</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php $signlist=\Kuxin\Block::show('sign', ['userid'=>$userinfo['id'],'num'=>5]);?>
                        <?php if(empty($signList)):?>
                        <tr>
                            <td colspan="5">您似乎来到了没有数据存在的荒原~~~</td>
                        </tr>
                        <?php else:?>
                        <?php if(is_array($signlist) && (array()!=$signlist)): $i=array(); $i['loop']=array_slice($signlist,0,null,true); $i['total']=count($signlist); $i['count']=count($i['loop']); $i['cols']=1; $i['add']=$i['count']%1?1-$i['count']%1:0; $i['order']=0; $i['row']=1;$i['col']=0;foreach(array_pad($i['loop'],$i['add'],array()) as $i['index']=>$i['list']): $loop=$i['list']; $i['order']++; $i['col']++; if($i['col']==1): $i['col']=0; $i['row']++; endif; $i['first']=$i['order']==1; $i['last']=$i['order']==$i['count']; $i['extra']=$i['order']>$i['count'];?>
                        <tr>
                            <td><?php echo \Kuxin\View::date($loop['datetime'],"Y-m-d H:i:s");?></td>
                            <td><?php echo $loop['num'];?></td>
                            <td><?php echo $loop['exp'];?></td>
                            <td><?php echo $loop['point'];?></td>
                        </tr>
                        <?php endforeach; endif;?>
                        <?php endif;?>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="relative pt-user-table mt10">
                <div style="line-height: 18px;margin-bottom:30px;">
                    <span class="size18 color2 mr10">邀请记录</span>
                    <a class="fr" href="<?php echo \Kuxin\Helper\Url::build("user.invite.index",[],"");?>">查看全部+</a>
                </div>
                <div>
                    <table>
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>用户/IP</th>
                            <th>类型</th>
                            <th><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.exp_caption");?>奖励</th>
                            <th><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.point_caption");?>奖励</th>
                            <th>签到时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php $invitelist=\Kuxin\Block::show('user.invitelist', ['userid'=>$userinfo['id']]);?>
                        <?php if(empty($inviteList)):?>
                        <tr class="empty">
                            <td colspan="6">您似乎来到了没有数据存在的荒原~~~</td>
                        </tr>
                        <?php else:?>
                        <?php if(is_array($invitelist) && (array()!=$invitelist)): $i=array(); $i['loop']=array_slice($invitelist,0,null,true); $i['total']=count($invitelist); $i['count']=count($i['loop']); $i['cols']=1; $i['add']=$i['count']%1?1-$i['count']%1:0; $i['order']=0; $i['row']=1;$i['col']=0;foreach(array_pad($i['loop'],$i['add'],array()) as $i['index']=>$i['list']): $loop=$i['list']; $i['order']++; $i['col']++; if($i['col']==1): $i['col']=0; $i['row']++; endif; $i['first']=$i['order']==1; $i['last']=$i['order']==$i['count']; $i['extra']=$i['order']>$i['count'];?>
                        <tr>
                            <td><?php echo $i['order'];?></td>
                            <td class="color2"><?php echo $loop['ext'];?></td>
                            <td>><?php echo \Kuxin\View::default($loop['type'],"注册","访问");?></td>
                            <td><?php echo $loop['exp'];?></td>
                            <td><?php echo $loop['point'];?></td>
                            <td><?php echo \Kuxin\View::date($loop['datetime'],"Y-m-d H:i:s");?></td>
                        </tr>
                        <?php endforeach; endif;?>
                        <?php endif;?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
	</div>

	<!-- 底部版权-->
    <div class="pt-copyright">
    <div class="pt-copyright-line"></div>
    <div class="color2 aboutlink">
        <?php $list=\Kuxin\Block::show('page.list', []);?>
        <?php if(is_array($list)): foreach($list as $key =>$loop):?>
        <a href="<?php echo \Kuxin\Helper\Url::build("page.detail",['pageid'=>$loop['id'],'key'=>$loop['key']],"");?>" title="<?php echo $loop['name'];?>"><?php echo $loop['name'];?></a>
        <?php endforeach; endif;?>
    </div>
    <div class="color4 footer-info" style="margin-top:28px;">Copyright © 2009 - 2019 <a href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "siteurl");?>" target="_blank"><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></a>. All Rights Reserved . 版权所有<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></div>
    <div class="color4 footer-info">本站内容系<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?>根据您的指令搜索各大小说站得到的链接列表，不代表<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?>赞成被搜索网站的内容或立场</div>
    <div class="color4 footer-info">如果版权人认为在本站放置您的作品有损您的利益，请发邮件至“<?php if(\Kuxin\Helper\Arr::getValue($_kxcms_config, "email")):?><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "email");?><?php else:?><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "qq");?>@qq.com<?php endif;?>”，本站确认后将会立即删除。</div>
    <div class="color4 footer-info">Power by <a href="http://www.ptcms.com" target="_blank">PT聚合小说搜索聚合程序 <?php echo PRO_VERSION;?> Build<?php echo PRO_TIME;?></a>，模版设计：<a href="http://www.pakey.net" target="_blank">Pakey</a>，<a href="http://www.miitbeian.gov.cn/" target="_blank" rel="nofollow"><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "beian");?></a></div>
    <div class="color4 footer-info"><?php echo \Kuxin\Response::runinfo();?></div>
</div>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/js/jquery-3.3.1.js"></script>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/js/layer/layer.js"></script>
<div class="none">
    <?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "tongji.pc");?>
    <?php if(\Kuxin\Helper\Arr::getValue($_kxcms_config, "app.use_cdn")):?>
    <script src="/api/stat/novel/info.js"></script>
    <script src="/api/stat/novel/read.js"></script>
    <?php endif;?>
</div>


    <script>
        var loading = null;
        $('.btn-sign').click(function(){
            var self = $(this);
            if (self.hasClass('btn-signed')){
                layer.msg('您今天已经签过到了，等明天再来吧！');
            }else{
                $.ajax('<?php echo \Kuxin\Helper\Url::build("user.sign.do",[],"");?>', {
                    type: 'post',
                    dataType: 'json',
                    beforeSend: function () {
                        if (loading == null) {
                            loading = layer.load(1, {shade: [0.1, '#000']});
                        }
                    },
                    complete: function () {
                        if (loading != null) {
                            layer.close(loading);
                            loading = null;
                        }
                    },
                    success: function (res) {
                        if (res.code) {
                            layer.alert(res.msg, {icon: 2,}, function (index) {
                                if (res.data.redirect) {
                                    window.location.href = res.data.redirect;
                                } else {
                                    layer.close(index);
                                }
                            });
                        } else {
                            var userDataBox = $('.pt-user-data');
                            var userLevelBox = $('.pt-user-level');
                            userDataBox.find('.user-level-name').text(res.data.name);
                            userDataBox.find('.user-exp').text(res.data.exp);
                            userDataBox.find('.user-print').text(res.data.print);
                            if (res.data.next) {
                                userLevelBox.find('.user-level-name').text(res.data.name);
                                userLevelBox.find('.user-next-level-name').text(res.data.next.name);
                                userLevelBox.find('.progress div').css('width', res.data.next.progress);
                            } else {
                                userLevelBox.find('.progress div').css('width', '100%');
                                userLevelBox.find('.user-next-level-name').hide();
                            }
                            var signRecordsBox = $('.sign-records tbody');
                            var trs = signRecordsBox.find('tr');
                            if (trs.length >= 10 || trs.length === 1 && trs.hasClass('empty')) {
                                signRecordsBox.find('tr:last').remove();
                            }
                            signRecordsBox.prepend('<tr><td>' + res.data.record.datetime + '</td><td>' + res.data.record.num + '</td><td>' + res.data.record.exp + '</td><td>' + res.data.record.point + '</td></tr>');
                            self.addClass('btn-signed').text('已签到');
                            layer.msg(res.msg);
                        }
                    },
                    error: function () {
                        layer.alert('推荐失败，请刷新页面后重试！', {icon: 2,});
                    }
                });
            }
        });
    </script>

	<!-- js-->
	<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/js/rankdetail.js"></script>
</body>
</html>